import { BasicFetchResult, BasicPageParams } from '/@/api/model/baseModel';

/**
 * @description: Login interface parameters
 */
export interface LoginParams {
  kernelName: string;
  password: string;
}

export interface CreateUserParam {
  kernelName: string;
  deptId: number;
  roleCode: string;
  nickname: string;
  name: string;
  mobile: string;
  email: string;
  slogan: string;
}

export interface UpdateUserParam {
  id: number;
  kernelName: string;
  deptId: number;
  roleCode: string;
  nickname: string;
  name: string;
  mobile: string;
  email: string;
  slogan: string;
}

export interface PwdParam {
  userId: number | string;
  passwordOld: string;
  passwordNew: string;
}

export interface RoleInfo {
  roleName: string;
  roleCode: string;
}

/**
 * @description: Login interface return value
 */
export interface LoginResultModel {
  loginCode: string | number;
  token: string;
  result: boolean;
}

/**
 * @description: Get user information return value
 */
export interface GetUserInfoModel {
  roles: RoleInfo[];
  // 用户id
  userId: string | number;
  // 用户名
  kernelName: string;
  // 真实名字
  realName: string;
  // 头像
  avatar: string;
  // 介绍
  desc?: string;
}

export interface UserListItem {
  id: string;
  name: string;
  kernelName: string;
  email: string;
  nickname: string;
  roleName: number;
  createTime: string;
  remark: string;
  status: number;
  mobile: string;
}

export type UserParams = BasicPageParams & {
  kernelName?: string;
  nickname?: string;
  deptId?: number;
};

export type UserListGetResultModel = BasicFetchResult<UserListItem>;
